package org.adream.account.controller;

import org.adream.account.aop.annotation.MonitorRequest;
import org.adream.account.entity.RealNameAuthEntity;
import org.adream.account.service.ADreamServiceException;
import org.adream.account.service.RealNameAuthService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * 实名认证 跳转页面
 * @author sl
 *
 */
@Controller
public class RealNameAuthController {
	
	private final static Logger logger = LoggerFactory.getLogger(RealNameAuthController.class);
	
	@Autowired
	private RealNameAuthService authService;
	
	//实名认证列表页
	@RequestMapping(value = "/realNameAuthPage")
	public ModelAndView realNameAuthView() {
		ModelAndView mv = new ModelAndView("/realNameAuth/realNameAuth");
		return mv;
	}
	
	//实名认证编辑页
	@RequestMapping(value = "/realNameAuthEditPage")
	@MonitorRequest
	public ModelAndView realNameAuthEditView(String uid) {
		ModelAndView mv = new ModelAndView("/realNameAuth/realNameAuth_edit");
		RealNameAuthEntity realNameAuth = authService.queryAuthByUid(uid);
		mv.getModel().put("realNameAuth", realNameAuth);
		return mv;
	}
	/**
	 * 查看实名信息 （照片等）
	 * 不做任何业务操作
	 * @return
	 */
	@RequestMapping(value = "/realNameInfoPage")
	public ModelAndView realNameInfoView() {
		ModelAndView mv = new ModelAndView("/realNameAuth/realNameInfo");
		return mv;
	}
	
	//实名信息查看页
	@RequestMapping(value = "/authInfoShowPage")
	@MonitorRequest
	public ModelAndView authInfoShowView(String uid) {
		ModelAndView mv = new ModelAndView("/realNameAuth/realNameInfo_show");
		RealNameAuthEntity realNameAuth = authService.queryAuthByUid(uid);
		mv.getModel().put("realNameAuth", realNameAuth);
		return mv;
	}
}